import * as types from './actionTypes'

const initialStore = {
  list: [],
  loading: false
}

export default (state = initialStore, action) => {
  switch (action.type) {
    case types.SET_LIST:
      return {
        ...state,
        list: action.data
      }
    case types.SET_LOADING:
      return {
        ...state,
        loading: action.data
      }
    default:
      return state
  }
}
